package com.inspur.gs.sbssdl.database.spqm.spqm.front.sbssryqm_frm.voactions;
import com.inspur.edp.bff.api.manager.context.QueryContext;
import com.inspur.edp.bff.spi.action.query.BeforeQueryAction;
import com.inspur.edp.cef.entity.condition.EntityFilter;
import com.inspur.edp.cef.entity.condition.FilterCondition;

import java.util.ArrayList;

public class queryBeforeVOAction extends BeforeQueryAction {

	public queryBeforeVOAction(QueryContext context){
		super(context);
	}
	@Override
	public void execute() {
		String userId = (String) this.getContext().getVariableData().getValue("user_id");

		if (userId != null && !userId.isEmpty()){
			EntityFilter filter = getQueryContext().getFilter();
			ArrayList<FilterCondition> filterList = new ArrayList<>(FilterCondition.builder()
					.andEqual("xtyh_ID", userId)
					.build());
			filter.addFilterConditions(filterList);

		}
	}
}
